﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Collections
{
    /// <summary>
    /// Common extensions for <see cref="ICollection"/>
    /// </summary>
    public static class ICollectionExtensions
    {
        /// <summary>
        /// Adds the elements of the specified collection to the end of the <see cref="ICollection"/>. 
        /// </summary>
        /// <typeparam name="TItem"></typeparam>
        /// <param name="coll"></param>
        /// <param name="items"></param>
        public static void AddRange<TItem>(this ICollection<TItem> coll, IEnumerable<TItem> items)
        {
            foreach (var item in items)
            {
                coll.Add(item);
            }
        }

    }
}
